//
//  MyDocumentsFolder.h
//  Documents
//
//  Created by Alex Di Mango 
//  Copyright (c) 2012 Whardoo.com -  All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>

@class MyDocumentsFolder;

@interface MyDocumentsFolder : NSManagedObject

@property (nonatomic, retain) NSNumber * folderId;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSNumber * layer;
@property (nonatomic, retain) NSNumber * defaultFolder;
@property (nonatomic, retain) NSMutableSet *documents;
@property (nonatomic, retain) NSDate * createDate;
@property (nonatomic, retain) NSString *color;

@end

@interface MyDocumentsFolder (CoreDataGeneratedAccessors)

- (void)addDocumentsObject:(NSManagedObject *)value;
- (void)removeDocumentsObject:(NSManagedObject *)value;
- (void)addDocuments:(NSSet *)values;
- (void)removeDocuments:(NSSet *)values;

+(NSMutableArray *)getFolders;
+(NSMutableArray *)getFolderList;
-(NSMutableArray *)getFolderListLastSyncDocs;
+(MyDocumentsFolder *)getFolderWithId:(NSNumber *)folderId;
+(NSArray *)getFolderWithName:(NSString *)name andFolderId:(NSNumber *)folderId;
+(BOOL)hasBeenModified:(NSNumber *)folderId;
+(BOOL)hasBeenOfflineAdded:(NSNumber *)folderId;

+(MyDocumentsFolder *)getDefaultFolder;
+(void)deleteFoldersNotIn:(NSMutableSet *)folderSet;
-(NSMutableArray *)getVisibleDocuments;
+(NSNumber *)getMaxFolderId;
+(MyDocumentsFolder *) addFolder: (NSString *)name;
+(void)deleteFolder:(MyDocumentsFolder *)folder;
+(NSNumber *)getSize:(NSNumber *)folderId;


@end

@protocol DocumentProtocol <NSObject>

-(NSNumber *)getFileId;
-(NSString *)getDocumentPath;
-(NSString *)getFolderName;
-(NSString *)getDocumentTitle;
-(NSString *)getFileType;

@end
